<template>
  <div>
    <h1>父组件</h1>
    <!-- <h1>{{info}}</h1>
    <h3>{{obj}}</h3> -->

    <son :info="info" :obj="obj" :msg="msg" @fun="fun"></son>
  </div>

</template>

<script lang="ts">
import { defineComponent,ref,reactive, provide, } from 'vue';
import Son from "./components/Son.vue"



export default defineComponent({
  name: 'App',
  components: {
    Son,
  },
  setup(){
    const info = ref("今天天气真好，我把被子晒了一下")
    provide("num",ref(1));
    provide("info",info);

    const obj = reactive({
      name:"lili",
      age:18,
    })

    const msg = ref("心中无女人，拔刀自然神")

    function fun(value:string){
      console.log("想吃烧烤，火锅，地锅鸡");
      console.log(info.value+ value);
      
      
    }

    return {
      info,
      obj,
      msg,
      fun,
    }
  }
});
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
